package com.heiye.count.biz.controller;

import com.heiye.count.api.dto.FindCommentCountByIdRspDTO;
import com.heiye.count.api.dto.FindCommentCountByIdsReqDTO;
import com.heiye.count.biz.service.CommentCountService;
import com.heiye.framework.biz.operationlog.aspect.ApiOperationLog;
import com.heiye.framework.common.response.Response;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: heiye
 * @date: 2025/08/07 上午11:45
 * @version: v1.0.0
 * @description: 评论计数业务
 */
@Slf4j
@RestController
@RequestMapping("/count")
public class CommentCountController {

    @Resource
    private CommentCountService commentCountService;

    // ===================================== 对其他服务提供的接口 =====================================

    @PostMapping(value = "/comments/data")
    @ApiOperationLog(description = "批量查询评论计数数据")
    public Response<List<FindCommentCountByIdRspDTO>> findCommentsCountData(@Validated @RequestBody FindCommentCountByIdsReqDTO findCommentCountByIdsReqDTO) {
        return commentCountService.findCommentsCountData(findCommentCountByIdsReqDTO);
    }
}
